package com.example.demo;

import com.example.demo.service.UserService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.List;

/**
 * MCP服务器应用程序入口类
 * 
 * @author: 徐飞龙
 * @date: 2024-03-19
 */
@SpringBootApplication
@MapperScan("com.example.demo.mapper")
public class McpServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(McpServerApplication.class, args);
    }

    @Bean
    public List<ToolCallback> danTools(UserService userService) {
        return List.of(ToolCallbacks.from(userService));
    }
}